package com.hare.common.utils;


import com.hare.common.exception.ServiceException;

/**
 * @program: Hare
 * @description: 断言工具类
 * @author: Hare
 * @create: 2022-11-15 16:03
 * @Version 6.0.1
 **/
public class AssertUtils {
    public static void isNull(Object obj, String msg) {
        if (null == obj) {
            throw new ServiceException(msg);
        }
    }

    public static void isTrue(boolean r, String msg) {
        if (r) {
            throw new ServiceException(msg);
        }
    }

    public static void isFalse(boolean r, String msg) {
        if (!r) {
            throw new ServiceException(msg);
        }
    }

}
